import request from '@/utils/request'

// 查询course_record列表
export function listRecord(query) {
    return request({
        url: '/course/record/list',
        method: 'get',
        params: query
    })
}

// 查询course_record详细
export function getRecord(id) {
    return request({
        url: '/course/record/' + id,
        method: 'get'
    })
}

// 新增course_record
export function addRecord(data) {
    return request({
        url: '/course/record',
        method: 'post',
        data: data
    })
}

//新增学习记录
export function addStudy(trainId,wareId) {
  var obj = {trainId:trainId,wareId:wareId};
  return request({
    url: '/course/record/study',
    method: 'post',
    data: obj
  })
}

// 修改course_record
export function updateRecord(data) {
    return request({
        url: '/course/record',
        method: 'put',
        data: data
    })
}

// 删除course_record
export function delRecord(id) {
    return request({
        url: '/course/record/' + id,
        method: 'delete'
    })
}
